package com.offcn.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

@Controller
public class LoginOutController {

     /*
        需求：退出登录
        URL:http://localhost/eastCMS/loginOut
        逻辑：1.接受请求
              2.清空登陆者信息，并跳转登录页面
    */
    @RequestMapping("loginOut")
    public  String loginOut(HttpServletRequest request){
        HttpSession session = request.getSession();
        session.setAttribute("loginUserVo",null);
        return "/redirect:login";
    }

}
